﻿<UserControl x:Class="MM.Hash.UI.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:app="clr-namespace:MM.Hash.UI"
    mc:Ignorable="d"
    d:DesignHeight="100" d:DesignWidth="650">

    <UserControl.Resources>
        <app:NotBooleanConverter x:Key="NotBooleanConverter" />
        <app:PercentageConverter x:Key="PercentageConverter" />
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="#F4F4F4">
        <StackPanel>
            <StackPanel Orientation="Horizontal" Height="25">
                <TextBox x:Name="inputFile" IsReadOnly="True" Width="560" HorizontalAlignment="Left" />
                <Button x:Name="btnBrowse" Content="Browse" Click="OnBrowsing" Width="70" Margin="5,0,0,0"  />
            </StackPanel>

            <StackPanel x:Name="pnlHash" Orientation="Horizontal" Margin="0,15,0,10" Visibility="{Binding ElementName=btnBrowse, Path=IsEnabled, Converter={StaticResource NotBooleanConverter}}" >
                <ProgressBar x:Name="pgbHash" HorizontalAlignment="Left" Width="500" Height="22"  />
                <TextBlock Margin="5,0,0,0" Text="{Binding ElementName=pgbHash, Path=Value, Converter={StaticResource PercentageConverter}}" />
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
